import { useState, useEffect } from 'react'
// import { useLanguage } from '@/stores'
// import { useRefresh } from '@/stores'
import { useTranslation } from 'react-i18next'
import './index.less'

const HistoryFinish = () => {

  const { t } = useTranslation(['bugManager'])

  // const hisToryFinishRefresher = useRefresh('historyFinish')

  const initData = () => {
    return {
      createTodoNumber: localStorage.getItem('createTodoNumber') || '0',
    }
  }

  const [historyFinishData, setHistoryFinishData] = useState(initData())

  // useEffect(() => {
  //   if (hisToryFinishRefresher.refreshKeyStatus) {
  //     setHistoryFinishData(initData())
  //     hisToryFinishRefresher.rebackRefresh()
  //   }
  // }, [hisToryFinishRefresher.refreshKeyStatus])


  return <div className='history-finish'>
    <div className='block-title'>{t('home.historyFinish.title')}</div>
    <div className='history-finish-list'>
      <div className='item'>
        <div className='title'>{t('home.historyFinish.createTodo')}</div>
        <div className='number'>{historyFinishData.createTodoNumber}</div>
      </div>
      <div className='item'>
        <div className='title'>{t('home.historyFinish.createStory')}</div>
        <div className='number'>0</div>
      </div>
      <div className='item'>
        <div className='title'>{t('home.historyFinish.finishTask')}</div>
        <div className='number'>106</div>
      </div>
      <div className='item'>
        <div className='title'>{t('home.historyFinish.submitBug')}</div>
        <div className='number'>0</div>
      </div>
      <div className='item'>
        <div className='title'>{t('home.historyFinish.solveBug')}</div>
        <div className='number'>1103</div>
      </div>
      <div className='item'>
        <div className='title'>{t('home.historyFinish.createCase')}</div>
        <div className='number'>0</div>
      </div>
      <div className='item'>
        <div className='title'>{t('home.historyFinish.createDoc')}</div>
        <div className='number'>4</div>
      </div>
    </div>
  </div>
}

export default HistoryFinish
